#include "mysql_result.h"

MySQLResult::MySQLResult(MYSQL_RES *res) : res_(res)
{
}

MySQLResult::~MySQLResult()
{
    if (res_)
        mysql_free_result(res_);
}

Iterator MySQLResult::begin()
{
    return Iterator(res_);
}

Iterator MySQLResult::end()
{
    return Iterator();
}

uint64_t MySQLResult::rowCount() const
{
    return res_->row_count;
}

uint32_t MySQLResult::fieldCount() const
{
    return mysql_num_fields(res_);
}